<template>
  <div>
    <div id="main2">
      python学历与薪资的关系
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts';


export default {
  name: "zhexiantu",
  mounted() {
    var myChart2 = echarts.init(document.getElementById('main2'));

      fetch("http://127.0.0.1:5000/getphthonzhexian").then((e) => {
        return e.json()
      }).then((e) => {
        //绘制折线图
          myChart2.setOption(
              {
                xAxis: {
                  type: 'category',
                  data: e[0]
                },
                yAxis: {
                  type: 'value'
                },
                series: [
                  {
                    data: e[1],
                    type: 'line'
                  }
                ]
              }
          )

      })



  }
}
</script>

<style scoped>
 #main2 {
  width: 100%;
  height: 400px;
}
</style>